﻿@model HR_ASP.ViewModel.StanowiskoViewModel
@{
    ViewBag.Title = "Stanowisko";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Edycja stanowiska</legend>
        @Html.HiddenFor(model => model.ID)
        <div class="editor-label">
            @Html.LabelFor(model => model.Nazwa)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nazwa)
            @Html.ValidationMessageFor(model => model.Nazwa)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Opis)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Opis)
            @Html.ValidationMessageFor(model => model.Opis)
        </div>
        <p>
            <table class="search">
                <tr>
                    <th>
                        Nazwa działu
                    </th>
                    <th>
                    </th>
                </tr>
                @foreach (var item in Model.Dzialy)
                {
                    <tr class="searchTr">
                        @Html.HiddenFor(model => item.ID)
                        <td>
                            @Html.DisplayFor(modelItem => item.Nazwa)
                        </td>
                        <td>
                            @Html.ActionLink("Usuń", "Delete","DzialStanow", new { IDDzial = item.ID , IDStanow = Model.ID },null)
                        </td>
                    </tr>
                }
            </table>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Lista stanowisk", "Index")
</div>
